package com.vgemv.jsutilitysdkdemo.module.NetworkState;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.RelativeLayout;

import androidx.annotation.Nullable;

import com.vgemv.jsutilitysdk.JsJsonManager.JsJsonManager;
import com.vgemv.jsutilitysdk.JsNetworkManager.JsIpInfoModel;
import com.vgemv.jsutilitysdk.JsNetworkManager.JsNetworkManager;

public class NetworkStateActivity extends Activity {

    RelativeLayout mRl_root;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mRl_root = new RelativeLayout(this);
        mRl_root.setId(View.generateViewId());
        setContentView(mRl_root);

        JsNetworkManager.generateSharedInstance(this).startNetworkMonitoring();
        JsIpInfoModel ipInfo = JsNetworkManager.sharedInstance().getCurrentIpInfo();
        String info = JsJsonManager.toJson(ipInfo,true);
        Log.i("ipifo",info);
    }



    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
    }
}
